<?php
namespace Home\Controller;

// use \Think\Controller;

class WeatherController extends HomeController
{
	public function getWeather()
	{

		$city = I('post.city', '上海');

		$url = 'http://api.map.baidu.com/telematics/v3/weather?location='.$city.'&output=json&ak=vqMyoRRwVgEq3tU1Wr6i0ij5';

		$api = new \Common\Util\ResultApi();
		$data = $api->getApiData($url, 'json');


		$this->assign('data', $data);

		$this->display();
	}
}
